{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import topmost\n",
    "from topmost import download_dataset\n",
    "\n",
    "device = \"cuda\"  # or \"cpu\"\n",
    "dataset_dir = \"./datasets/NYT\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "https://raw.githubusercontent.com/BobXWu/TopMost/master/data/NYT.zip\n",
      "Using downloaded and verified file: ./datasets/NYT.zip\n"
     ]
    }
   ],
   "source": [
    "download_dataset('NYT', cache_path='./datasets')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "all train size:  8254\n",
      "all test size:  918\n",
      "all vocab size:  10000\n",
      "average length: 175.429\n",
      "num of each time slice:  11 [ 194  265  431  554  744  837  802  884 1283 1400  860]\n"
     ]
    }
   ],
   "source": [
    "# load a dataset\n",
    "dataset = topmost.DynamicDataset(dataset_dir, batch_size=200, read_labels=True, device=device)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "  0%|          | 0/800 [00:00<?, ?it/s]"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 800/800 [27:57<00:00,  2.10s/it]\n"
     ]
    }
   ],
   "source": [
    "# create a model\n",
    "# model = topmost.models.DETM(\n",
    "#     vocab_size=dataset.vocab_size,\n",
    "#     num_times=dataset.num_times,\n",
    "#     train_size=dataset.train_size,\n",
    "#     train_time_wordfreq=dataset.train_time_wordfreq,\n",
    "#     device=device,\n",
    "# )\n",
    "# model = model.to(device)\n",
    "# trainer = topmost.trainers.DynamicTrainer(model, epochs=400)\n",
    "\n",
    "model = topmost.CFDTM(\n",
    "    vocab_size=dataset.vocab_size,\n",
    "    num_times=dataset.num_times,\n",
    "    pretrained_WE=dataset.pretrained_WE,\n",
    "    train_time_wordfreq=dataset.train_time_wordfreq,\n",
    ")\n",
    "model = model.to(device)\n",
    "trainer = topmost.DynamicTrainer(model, dataset, epochs=800)\n",
    "\n",
    "top_words, train_theta = trainer.train()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Notice: Fix the bug of invalid values of coherence models in gensim following [RaRe-Technologies/gensim#3040](https://github.com/RaRe-Technologies/gensim/issues/3040#issuecomment-812913521)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "======= Time: 0 =======\n",
      "Topic 0: officer officers police bull man arrested driver grandson shot driving street fatally boy heir bystanders\n",
      "Topic 1: news horses hbo affidavit scandal british murdoch book sexual abuse sex charges women authorities activities\n",
      "Topic 2: art neighborhood artist space museum building center roosevelt million queens place apartment century brooklyn sale\n",
      "Topic 3: slide subscriber planet happens gift messenger ice page frozen reveal islands articles fortunes cold degrees\n",
      "Topic 4: school schools students education student parents teachers children chicago programs strike teacher district safe lin\n",
      "Topic 5: doctors home getting hospital wave patients got keep town morning started hour closed medical someone\n",
      "Topic 6: like want something know care love just people applause man clothing right going police back\n",
      "Topic 7: museums agency library emirates station plan dhabi climate land authority bridge air water abu project\n",
      "Topic 8: republican election race elections presidential candidate run candidates abdullah governor democratic results fraud republicans senate\n",
      "Topic 9: water weather homes air storm hit river beijing storms residents across areas power deaths dead\n",
      "Topic 10: republican conservative candidates republicans candidate senate voters support vote romney majority election clinton recess endorse\n",
      "Topic 11: senate republicans senator bill democrats congress legislation tax house lawmakers spending measure changes immigration passed\n",
      "Topic 12: police officers officer shooting video department force gun man crime charged stop shot boston death\n",
      "Topic 13: orthodox jerusalem ultra israeli israel jewish wall jews rabbi netanyahu religious benjamin women prayer prime\n",
      "Topic 14: game players won season games play win league team played player open match title final\n",
      "Topic 15: catalonia spain independence catalan madrid minister prime parliament rajoy referendum barcelona separatist european party parties\n",
      "Topic 16: drug patients injections doctors pain contaminated england disease drugs injection tennessee received treatment medicine court\n",
      "Topic 17: health symptoms medical cancer drug disease care study unnecessary insurance healthy commonly screening income drugs\n",
      "Topic 18: privacy consumers data information facebook online social internet companies technology users google tech apps web\n",
      "Topic 19: game games olympics red tokyo host olympic summer players winter play sports baseball mario japan\n",
      "Topic 20: opponent describing tough colonel get trail negative municipal thanks biden ally hot else capture worried\n",
      "Topic 21: corruption rousseff arrested arrest dilma moscow brazil rights torture janeiro prosecutor human dictatorship rio charges\n",
      "Topic 22: opera production musical met music performance orchestra metropolitan productions season film theater show characters sung\n",
      "Topic 23: film documentary rodriguez book novel young musician greek rachel title men movies characters sound absurd\n",
      "Topic 24: hong kong beijing chinese protests taiwan protesters democracy protest pro communist demonstrations china territory mainland\n",
      "Topic 25: book novel life story books movie writer stories artist brown art published portrait space modern\n",
      "Topic 26: rate tax prices percent market economic rates interest financial pension growth stock pay low bank\n",
      "Topic 27: south black church african rights white civil flag carolina americans hate battle mass far shooting\n",
      "Topic 28: nuclear missile security nsa intelligence bush agency computer natanz program vehicles north korea command spying\n",
      "Topic 29: afghan killed taliban american military afghans attack afghanistan general soldiers senior militant kandahar wounded forces\n",
      "Topic 30: cases positive tested travel restrictions disease contact days spread infected reported health announced country symptoms\n",
      "Topic 31: project jersey tunnel costs new share amtrak governor arc report transportation manhattan hudson york christie\n",
      "Topic 32: court law judge case supreme justice ruling federal rights texas district sex voter ruled legal\n",
      "Topic 33: stock trading billion markets investors company market fund exchange quarter wall bank investment cash shares\n",
      "Topic 34: colonel imprisoned municipal uprising fit wondered socialist feminist words get useful col greatest scholarship describing\n",
      "Topic 35: prince royal british king father wife monarchy son queen family fetus palace london throne duchess\n",
      "Topic 36: mayor cuomo blasio city york gov fund housing legislature albany andrew governor council hall new\n",
      "Topic 37: cohen amazon iraq iraqi lost syria films zealand women oil fighters said barring weekends music\n",
      "Topic 38: chief banks chicago army secretary farmers human violent philip commissioner crime director warren mayor interim\n",
      "Topic 39: apple samsung microsoft google technology mobile customers smartphones android products tech iphone software vehicles patent\n",
      "Topic 40: players sports league draft game team baseball season puerto teams play college major nba university\n",
      "Topic 41: iran nuclear iranian sanctions tehran uranium enrichment scientist natanz assassination united china countries exports iranians\n",
      "Topic 42: china party chinese communist political wen jinping islands leader beijing north japan decade business wife\n",
      "Topic 43: putin meeting president white vladimir moscow sanctions russia vice remarks obama trade secretary arms jinping\n",
      "Topic 44: authorized machine colonel economist theory rocked racially robust shortages insiders worst unemployment shipments count containers\n",
      "Topic 45: fbi investigation cia affair committee inquiry classified intelligence information investigating department secret lawyer chairmen bureau\n",
      "Topic 46: ali egypt tons communist tens survey vladimir mexico mexican miss cautious defeat conspiracy ross outlets\n",
      "Topic 47: mom happening locked imprisoned municipal sense coup feels describing suddenly obviously anxiety uprising socialist colonel\n",
      "Topic 48: economist recession jobs gross statistics municipal laid employment vermont mom worst essential depression economics recovery\n",
      "Topic 49: taliban afghan immigration syria border immigrants thousands syrian fish deportation afghanistan assad lebanon kabul afghans\n",
      "======= Time: 1 =======\n",
      "Topic 0: officer officers police man arrested killing driver shot bull boy fatally street grandson driving attack\n",
      "Topic 1: news sexual women sex scandal abuse british murdoch book fox charges allegations rupert accused media\n",
      "Topic 2: art artist space neighborhood museum auction million sale building works apartment painting estate buildings sold\n",
      "Topic 3: slide subscriber happens carved planet gift pretending rafael motive frantic dissidents ruthless islands margaret lady\n",
      "Topic 4: school schools students education student parents children teachers programs district chicago strike safe teacher profit\n",
      "Topic 5: doctors home getting hospital wave patients got hour morning started keep medical town closed someone\n",
      "Topic 6: like want just know people something love right care man going police back really time\n",
      "Topic 7: library agency station climate plan land museums change authority housing bridge water air tenants project\n",
      "Topic 8: election republican elections race presidential candidate abdullah results run fraud candidates democratic governor republicans senate\n",
      "Topic 9: shanghai water pigs beijing river air environmental plants deaths farmer pollution diesel infighting power farmers\n",
      "Topic 10: republican conservative candidates republicans senate candidate clinton support voters majority election vote representative democratic money\n",
      "Topic 11: senator senate republicans democrats bill congress legislation house lawmakers tax democrat gillibrand immigration changes obama\n",
      "Topic 12: police officers marathon boston officer finish spectators video park shooting swat runners organizers campbell races\n",
      "Topic 13: jerusalem israeli orthodox israel ultra wall jewish jews prayer pray netanyahu prime palestinians rabbi religious\n",
      "Topic 14: djokovic season players seeded won game match ball games title player tournament stadium fans played\n",
      "Topic 15: catalan minister spain prime catalonia referendum party independence parliament european madrid parties thatcher britain spanish\n",
      "Topic 16: drug pain drugs doctors patients injection execution disease treatment injections abortions court heart available used\n",
      "Topic 17: health insurance income medicaid care expansion poor drug poverty medical uninsured subsidies exchanges incomes study\n",
      "Topic 18: social facebook users online tech google apps companies internet technology consumers twitter media data app\n",
      "Topic 19: game games olympics tokyo red host olympic summer players winter sports mario play series baseball\n",
      "Topic 20: opponent colonel municipal describing tough scientist ally remarks wary negative greatest trail stroke thanks candidacy\n",
      "Topic 21: arrested corruption arrest rousseff brazil diplomat dilma charges rights prosecutor moscow indian torture janeiro prison\n",
      "Topic 22: opera musical performance production metropolitan music met theater broadway audience voice season performances ballet film\n",
      "Topic 23: novel book film sound seems work life good story something lot men like documentary reader\n",
      "Topic 24: hong kong beijing chinese protests protesters tear pro protest democracy taiwan territory demonstrations communist authorities\n",
      "Topic 25: book novel life story books movie writer stories brown published art artist read woman saw\n",
      "Topic 26: prices rate percent market growth economic financial tax price stock inflation rates interest economy higher\n",
      "Topic 27: south black church african rights white flag civil mass hate shooting violence battle far catholic\n",
      "Topic 28: security intelligence computer agency hackers nsa snowden surveillance access classified edward systems phone computers documents\n",
      "Topic 29: afghan killed attack syria rebel syrian military american taliban assad soldiers militant fighters islamic forces\n",
      "Topic 30: cases positive travel restrictions disease tested days contact country health spread reported announced countries doctor\n",
      "Topic 31: new project share percent jersey governor york report tunnel suit manhattan included north arc average\n",
      "Topic 32: court law supreme justice sex case ruling judge marriage ruled decision justices federal rights couples\n",
      "Topic 33: stock trading billion quarter markets subscribers cable investors wall warehouses goldman aluminum market cash subpoenas\n",
      "Topic 34: colonel imprisoned municipal uprising fit socialist feminist col wondered greatest useful teenagers words bears shouting\n",
      "Topic 35: son father wife family king husband mother statement child british zhang planning ballet baby parents\n",
      "Topic 36: cuomo mayor blasio york city gov albany governor legislature fund andrew housing commission estate donors\n",
      "Topic 37: cohen lost iraq amazon women syria iraqi said woman music oil sexual fighters editor full\n",
      "Topic 38: chief banks chicago army secretary human philip crime commissioner violent director mayor acting farmers department\n",
      "Topic 39: apple samsung mobile customers google technology smartphones vehicles iphone microsoft phone cars products android apps\n",
      "Topic 40: players sports nba team game league player gay season baseball soccer coach sport play rogers\n",
      "Topic 41: iran nuclear sanctions countries united iranian china european trade russia europe states agreement nations exports\n",
      "Topic 42: party china chinese communist jinping islands political beijing leader official japan hong korea reform kong\n",
      "Topic 43: meeting putin president vladimir moscow white sanctions obama russia secretary trade arms nato aides remarks\n",
      "Topic 44: authorized colonel machine economist count chancellor reveals improperly shortages motivations treatments problems robust insiders holocaust\n",
      "Topic 45: fbi investigation inquiry department information committee lawyer attorney investigating classified email justice intelligence comey affair\n",
      "Topic 46: ali egypt tons communist vladimir tens relations mexican mexico muslims cautious defeat conspiracy victory considered\n",
      "Topic 47: mom happening locked sense municipal imprisoned feels coup describing obviously uprising suddenly fit socialist anxiety\n",
      "Topic 48: economist recession gross jobs statistics municipal laid employment vermont angela recovery inflicted usual depression worst\n",
      "Topic 49: taliban afghan immigration border syria thousands immigrants syrian migrants lebanon migrant asylum assad afghans rebel\n",
      "======= Time: 2 =======\n",
      "Topic 0: officer officers police man driver arrested shot killing street car boy driving crash attack died\n",
      "Topic 1: news book british scandal editor hacking ailes tabloid sexual women rupert magazine fox story phone\n",
      "Topic 2: art museum museums artist auction property space clark building contemporary century million apartments estate liu\n",
      "Topic 3: happens slide planet workings elegant headlines reveal subscriber explanation ferguson rockets inner gift episodes catastrophe\n",
      "Topic 4: school schools students education student parents programs children profit loan chicago colleges loans passage strike\n",
      "Topic 5: doctors home getting wave patients hospital got keep morning hour started someone town medical turned\n",
      "Topic 6: work like just care day hours want gavin get people time now stop know job\n",
      "Topic 7: climate library plan change bridge carbon pollution emissions agency authority station environmental warming plants water\n",
      "Topic 8: abdullah election ghani candidate republican presidential fraud results afghan ashraf race elections candidates votes runoff\n",
      "Topic 9: tornadoes weather casino atlantic tornado storms water weary plaza stunned areas rubble river earthquakes severe\n",
      "Topic 10: republican conservative republicans senate candidate representative majority support candidates election vote giving scalise clinton observers\n",
      "Topic 11: republicans senate senator democrats house congress immigration bill legislation boehner lawmakers washington lynch obama democrat\n",
      "Topic 12: police officers officer swat cafe gear video shooting ferguson garner departments sydney chokehold hostages force\n",
      "Topic 13: israeli israel gaza nations hamas palestinian jerusalem palestinians cease fire netanyahu fighting conflict prime militants\n",
      "Topic 14: djokovic game players won cup season match fans ball games brazil scored play played final\n",
      "Topic 15: party minister prime parliament parties european elections won leader independence spain vote hollande britain seats\n",
      "Topic 16: execution drug drugs lethal injection oklahoma pain corrections executions injections minutes physician penalty heart ohio\n",
      "Topic 17: health drug marijuana income drugs care insurance study medical medicaid infants disease symptoms subsidies treatment\n",
      "Topic 18: facebook apps google tech social users twitter online silicon internet media technology companies privacy content\n",
      "Topic 19: games game olympics olympic host tokyo medal sample sampling mario winter gold red players angeles\n",
      "Topic 20: opponent biden colonel municipal candidacy describing ally remarks politicians presidency progressive wary tough greatest absolutely\n",
      "Topic 21: rousseff dilma arrested corruption brazil arrest janeiro petrobras rio brazilian rights dictatorship charges torture prison\n",
      "Topic 22: opera musical production performance music theater met season album metropolitan performances characters swift voice songs\n",
      "Topic 23: women work men good lot careers book age child career like dad want think seems\n",
      "Topic 24: hong kong beijing democracy chinese pro protesters protest protests communist legislature crackdown movement tear free\n",
      "Topic 25: book novel life story movie books writer saw woman stories artist published art portrait catch\n",
      "Topic 26: percent prices rate economic growth rates inflation tax market income price higher financial economy interest\n",
      "Topic 27: catholic ethnic ali south church irish civil rights nationalist hate flag ireland african gay battle\n",
      "Topic 28: agency information commission obama records panel data nsa gas cuomo natural epa says security investigation\n",
      "Topic 29: islamic afghan syria taliban militants isis forces killed iraq army fighters province hostages syrian military\n",
      "Topic 30: cases positive disease tested contact ebola spencer symptoms restrictions travel fever spread doctor infected days\n",
      "Topic 31: suit cdc gloves guidelines north shore level original ebola contact hood upgraded bodily dallas shown\n",
      "Topic 32: court democrat photo charges convicted manhattan case guilty justice assemblyman pleaded judge sex law fraud\n",
      "Topic 33: stock billion investors markets market quarter investment company cash fund sales trading wall financial funds\n",
      "Topic 34: colonel imprisoned municipal uprising fit serve biden greatest col words get wondered recording socialist locked\n",
      "Topic 35: family son father wife king child husband parents mother british spain baby juan carlos zhang\n",
      "Topic 36: york cuomo mayor city blasio new gov pictures governor rachel hall andrew albany attorney estate\n",
      "Topic 37: oil isis syria iraq iraqi forces islamic turkey fighters jewish said areas group border control\n",
      "Topic 38: chief banks chicago commissioner philip secretary director position department army crime mayor deputy acting human\n",
      "Topic 39: apple google mobile samsung technology customers smartphone smartphones tech apps vehicles software battery iphone patent\n",
      "Topic 40: players team nba sports nfl game sam league gay name season soccer play brand player\n",
      "Topic 41: countries nuclear china united iran sanctions european states trade treasury taxes nations foreign agreement american\n",
      "Topic 42: china chinese jinping communist beijing party vietnam hong kong islands korea ships reform leader official\n",
      "Topic 43: putin vladimir moscow russia ukraine meeting sanctions president crimea troops nato invasion kremlin eastern alliance\n",
      "Topic 44: authorized colonel economist machine jennifer count treatments problems theory reveals chancellor disagreement johnson america marco\n",
      "Topic 45: fbi investigation information lawyer committee department inquiry email clinton former intelligence classified justice trump attorney\n",
      "Topic 46: ali egypt tons communist tens relations mexican vladimir victory defeat survey opponent conspiracy widespread considered\n",
      "Topic 47: mom happening sense locked municipal feels progressive coup imprisoned listen describing obviously minnesota biden going\n",
      "Topic 48: economist recession gross jobs statistics municipal laid employment vermont politicians suspicions essential promised usual slowdown\n",
      "Topic 49: taliban afghan border thousands immigration syria syrian migrants immigrants migrant lebanon afghanistan assad kabul bangladesh\n",
      "======= Time: 3 =======\n",
      "Topic 0: officer driver goldberg man officers crash gray arrested bronx police car killing boy died driving\n",
      "Topic 1: british news murdoch bank hacking charges phone rupert scandal authorities rate criminal tabloid james editor\n",
      "Topic 2: art painting million museum liu auction exhibition artist species century artists sale collection paintings discovery\n",
      "Topic 3: subscriber slide gift workings earthquake raqqa happens elegant headlines bustling nepal perils planet continental motive\n",
      "Topic 4: school schools students education student parents programs children teachers profit strike chicago safe colleges loans\n",
      "Topic 5: doctors home getting patients wave hospital got keep morning hour closed town medical started turned\n",
      "Topic 6: applause like just people grace want know see bell now make think flag smith going\n",
      "Topic 7: station nyu campus agency transit authority project bridge jersey rail developers delays emirates library madison\n",
      "Topic 8: election republican race candidate abdullah presidential democratic run results candidates fraud elections ghani governor fox\n",
      "Topic 9: water earthquake nepal plant april drought residents california camp air homes temple environmental square heritage\n",
      "Topic 10: cruz rubio candidate candidates clinton republican raised christie support donors money raising bush scalise mrs\n",
      "Topic 11: republicans senate bill senator democrats congress legislation house lynch immigration lawmakers democrat washington measure passed\n",
      "Topic 12: officer officers police video shooting chicago department death baltimore inmates mcdonald charges charged gun prison\n",
      "Topic 13: israeli netanyahu israel prime nations benjamin minister conflict hamas palestinian gaza jerusalem negotiations jewish militants\n",
      "Topic 14: game players games season fans team cup league play teams played won ball player soccer\n",
      "Topic 15: party minister prime parliament european elections parties won leader union spain britain vote labour seats\n",
      "Topic 16: drug execution lethal executions oklahoma court drugs injection inmates injections penalty stay corrections scheduled justices\n",
      "Topic 17: health study insurance drug care subsidies medical marijuana cancer drugs disease income customers patient markets\n",
      "Topic 18: facebook app users apps social google twitter internet tech online content silicon media technology snapchat\n",
      "Topic 19: game games olympics olympic tokyo host abe medal mario racing athletes shinzo players red hurricane\n",
      "Topic 20: opponent colonel describing ally absolutely scientist candidacy politicians undermining laid oval essential municipal swift skeptical\n",
      "Topic 21: petrobras rousseff scandal dilma corruption brazil graft janeiro bribes saudi rio silva executives bin arrested\n",
      "Topic 22: musical theater dance opera broadway show season music graham viewers night awards live star choreographer\n",
      "Topic 23: men book women novel work mother time done life dream spend career man nothing good\n",
      "Topic 24: hong kong paris french france newspaper charlie beijing suspects brothers xinjiang brittney islam democracy metal\n",
      "Topic 25: book novel life story movie writer books art stories brown fiction space published woman saw\n",
      "Topic 26: spending tax caps rates rate trillion market prices percent pay budget inflation financial income economic\n",
      "Topic 27: flag confederate carolina south charleston church haley battle bass symbols remove massacre nikki lowering rights\n",
      "Topic 28: families family energy made wealth candidates donors oil finance private million gas money half new\n",
      "Topic 29: killed islamic isis attack syria yemen claimed afghan taliban coalition forces least killing syrian attacks\n",
      "Topic 30: cases positive disease tested contact restrictions travel days health reported spread outbreak symptoms hotel tests\n",
      "Topic 31: likely marriage percent less age places new children north marry based married states poor level\n",
      "Topic 32: court justice silver case judge manhattan law sheldon sex assembly corruption democrat fraud supreme charges\n",
      "Topic 33: billion stock yahoo alibaba stake investors shares value shareholders investment company sales markets market securities\n",
      "Topic 34: colonel imprisoned municipal uprising fit serve col socialist locked greatest diplomacy wondered describing russians shouting\n",
      "Topic 35: father wife british son family king statement prince queen london husband release parents royal mother\n",
      "Topic 36: mayor york blasio city cuomo housing homeless new homelessness governor gov shelter albany budget andrew\n",
      "Topic 37: boko haram said isis amazon women militants syria islamic woman iraqi forces fighters iraq told\n",
      "Topic 38: chief banks secretary chicago director commissioner crime mayor department army human acting deputy philip violent\n",
      "Topic 39: apple technology google vehicles car cars tech driving software customers mobile app product uber safety\n",
      "Topic 40: university players students costumes halloween football campus racial missouri college athletes faculty yale team nfl\n",
      "Topic 41: iran russia countries nuclear united sanctions china europe foreign european states oil western investment ocean\n",
      "Topic 42: china chinese communist beijing jinping hong party kong leader female opening decade reform official islands\n",
      "Topic 43: putin president meeting vladimir white sanctions russia moscow ukraine secretary obama trade trump nato washington\n",
      "Topic 44: treatments colonel jennifer theory problems legalize policing economist authorized supplies unemployment reserve integrity pivot oval\n",
      "Topic 45: fbi information clinton email investigation emails committee department hillary lawyer classified inquiry intelligence mrs campaign\n",
      "Topic 46: ali egypt communist tons mexican survey conspiracy hero vladimir hunter mexico opponent tens cautious relations\n",
      "Topic 47: happening mom sense locked imprisoned municipal describing coup listen wear hill feels minnesota anxiety modi\n",
      "Topic 48: economist recession jobs gross statistics laid municipal employment slowdown suspicions essential vermont yorkers angela usual\n",
      "Topic 49: afghan taliban migrants syria syrian refugee refugees afghanistan border pakistan lebanon syrians immigration pakistani europe\n",
      "======= Time: 4 =======\n",
      "Topic 0: truck officer christmas man berlin officers killing paris police attack stabbed bodies nice shot france\n",
      "Topic 1: fox ailes news sexual murdoch allegations harassment british roger accusations network jury lawyer women complaint\n",
      "Topic 2: building tiny site floor oakland brooklyn apartment tower art apartments space entrance stairs museum estate\n",
      "Topic 3: subscriber slide ramadan gift mayer wildlife verizon calendar sluggish commuters workings completion refuge yahoo messenger\n",
      "Topic 4: school schools students education student parents children programs safe teachers passage profit chicago strike routes\n",
      "Topic 5: doctors home getting keep patients hospital got wave morning closed hour started stay medical town\n",
      "Topic 6: know saudi just like people now think pilgrims arabia going see crush one say middle\n",
      "Topic 7: station registration plane grounded project rail jersey tunnel jet developers aircraft expired agency amtrak hudson\n",
      "Topic 8: republican election race bannon fraud seat presidential candidate elections democratic results senate candidates abdullah runoff\n",
      "Topic 9: puerto air rico water plant authority environmental beijing monitoring island pollution electricity researchers indian disaster\n",
      "Topic 10: clinton donald mrs campaign hillary trump presidential candidates republican candidate donors rubio polls debate convention\n",
      "Topic 11: senate republicans bill democrats senator congress legislation house tax passed act measure lawmakers changes immigration\n",
      "Topic 12: officers police officer gunman shooting death restaurant gray video man freddie orlando gunfire main evidence\n",
      "Topic 13: israeli israel netanyahu prime jews orthodox jewish minister jerusalem benjamin nations wall prayer ultra palestinians\n",
      "Topic 14: bitcoin software season virtual players games currency transactions game warriors wolf episodes sports currencies won\n",
      "Topic 15: party european minister union parliament prime elections leader right won britain parties anti wing conservative\n",
      "Topic 16: court drug broadband abortion ruling supreme providers appeals affirmed drugs abortions clinic judge utility neutrality\n",
      "Topic 17: health insurance care drug cancer obamacare income study poor coverage adults affordable medical medicaid bills\n",
      "Topic 18: facebook twitter social news media users content publishers google snapchat app internet online tech companies\n",
      "Topic 19: game games players mobile mario olympics gaming devices snapchat play sports switch tokyo smartphones hawks\n",
      "Topic 20: opponent colonel absolutely scientist candidacy describing get municipal laid swift essential ally politicians recovery defendant\n",
      "Topic 21: corruption rousseff silva dilma scandal graft petrobras brazil charges brazilian janeiro arrest impeachment fifa arrested\n",
      "Topic 22: theater songs opera literature music prize nobel musical song writer pop bob broadway album award\n",
      "Topic 23: film think work novel time good thought look know want women things robots men like\n",
      "Topic 24: hong kong beijing democracy chinese pro taiwan paris autonomy protests legislative newspaper france colony communist\n",
      "Topic 25: movie book writer art life story books novel fiction whose published poetry film review artist\n",
      "Topic 26: inflation tax income economic rate percent prices rates price market spending growth jobs economy production\n",
      "Topic 27: flag confederate south church carolina charleston remove symbols gay battle african massacre rally nine black\n",
      "Topic 28: security airport screening terminal flow passengers airports mentioned dogs lines checkpoints speeches drop agency cars\n",
      "Topic 29: killed islamic afghan taliban kabul attack forces suicide boko attacks civilians killing haram bomber iraqi\n",
      "Topic 30: cases positive disease restrictions tested contact travel days health reported spread outbreak announced hotel country\n",
      "Topic 31: voters vote among percent likely clinton polls race poll white mrs voter lead north upshot\n",
      "Topic 32: court justice case judge law supreme rights transgender civil district federal sex sentence silver scalia\n",
      "Topic 33: investors stock billion bank uber markets investment mortgage securities market deutsche bond valuation bonds financial\n",
      "Topic 34: colonel imprisoned municipal fit get uprising sick serve sense alarm need bears biden diplomacy sat\n",
      "Topic 35: father queen king wife british mother cameron prince offshore son london privacy family elizabeth statement\n",
      "Topic 36: blasio cuomo mayor city budget york governor raise council gov bill albany commission andrew wage\n",
      "Topic 37: forces iraqi mosul iraq isis kurdish areas miles area islamic troops syria river villages baghdad\n",
      "Topic 38: chief chicago mayor banks director secretary commissioner crime violent emanuel department job deputy army acting\n",
      "Topic 39: technology tesla google uber driving vehicles apple cars autonomous car tech self app artificial musk\n",
      "Topic 40: university students orchestra college musicians players campus contract alumni student costumes halloween sports management heritage\n",
      "Topic 41: trade united countries exports china canada imports states chinese mexico goods billion total companies investment\n",
      "Topic 42: north korea china korean beijing sea taiwan philippines islands south waters otto warmbier kim pyongyang\n",
      "Topic 43: president meeting putin white sanctions moscow vladimir russia trump elect vice aides secretary washington obama\n",
      "Topic 44: problems policing treatments jennifer colonel supplies economist chancellor recession integrity pelosi investigations legalize count jessica\n",
      "Topic 45: fbi information emails email investigation committee intelligence classified department related deleted inquiry clinton lawyer director\n",
      "Topic 46: ali egypt hero champion rounds smashed muhammad tons sinai ross abdel fattah cautious cairo sisi\n",
      "Topic 47: mom happening sense wear locked feeling municipal coup lose situation minnesota get feels listen safe\n",
      "Topic 48: economist recession jobs gross statistics laid municipal employment essential economy get downturn numbers sense epidemic\n",
      "Topic 49: afghan syrian taliban syria migrants refugees rebel afghanistan afghans aleppo assad syrians lebanon border fighters\n",
      "======= Time: 5 =======\n",
      "Topic 0: officers officer man police truck shot killing arrested attack paris killed identified street suspect dead\n",
      "Topic 1: fox sexual harassment allegations media sky news century murdoch weinstein women accusations harvey broadcast rupert\n",
      "Topic 2: building art buildings space auction painting dance square street star artists wang artist apartment old\n",
      "Topic 3: slide subscriber gift elegant workings dogs dame hurricanes empathy happens verizon yahoo headlines ramadan wildlife\n",
      "Topic 4: school education schools students programs parents student teachers profit children chicago teacher loan regulations loans\n",
      "Topic 5: doctors home patients getting hospital wave keep got medical closed hospitals stay sick store mask\n",
      "Topic 6: children home one people said like mother now many old two water just years year\n",
      "Topic 7: agency epa pruitt environmental climate consumer protection water scientists rules change budget lead regulations scott\n",
      "Topic 8: republican race election candidate democratic governor candidates elections presidential run voting republicans senate fraud results\n",
      "Topic 9: hurricane storm islands puerto water rico irma maria homes island caribbean emergency hit air weather\n",
      "Topic 10: republican election democratic results primary democrats republicans congressional political trump candidate campaign won vote candidates\n",
      "Topic 11: tax republicans senate bill congress legislation democrats treasury senator spending cuts affordable measure medicaid act\n",
      "Topic 12: police officers officer shooting rep gunman fire floor shot scalise coming victims fired hotel room\n",
      "Topic 13: israel israeli jerusalem arab peace netanyahu qatar prime arabia palestinians minister orthodox jews jewish ultra\n",
      "Topic 14: games players season game cup yards league teams team nfl olympics won rushing played sports\n",
      "Topic 15: party european parliament minister independence prime catalan union referendum wing spain rajoy catalonia spanish leader\n",
      "Topic 16: court supreme judge order courts travel judges appeals ban ruling federal circuit decision ruled lawyers\n",
      "Topic 17: health drug care insurance plan lower cost higher prices plans income coverage buying obamacare insurers\n",
      "Topic 18: facebook google twitter ads social users zuckerberg accounts tech app instagram network information linked online\n",
      "Topic 19: game games switch olympics devices baseball sox tea players red olympic mobile mario signs league\n",
      "Topic 20: opponent candidacy colonel scientist virtue brazilian swift absolutely apologize essential honored bizarre municipal accuses legalization\n",
      "Topic 21: saudi arabia corruption prince bin crown mohammed salman dhabi abu rousseff kingdom silva arab navalny\n",
      "Topic 22: album theater season song opera pop netflix ratings film production music festival episode abc directed\n",
      "Topic 23: want think know lot something bipartisan like look come going hard feel good means get\n",
      "Topic 24: hong kong beijing taiwan chinese democracy china protests mainland lee activist taiwanese handover pro protest\n",
      "Topic 25: brown life movie book dance writer story novel books love art jenkins film cancer stories\n",
      "Topic 26: tax inflation rate economic income percent rates growth jobs fed taxes interest retail financial economy\n",
      "Topic 27: confederate charlottesville church rally south nationalists carolina park violence symbols statue white monuments nationalist roof\n",
      "Topic 28: missile north korea nuclear warhead stage miles bomb defense vehicle emissions facility body kim analysts\n",
      "Topic 29: islamic taliban afghan forces killed iraqi attack fighters mosul afghanistan kabul civilians isis attacks iraq\n",
      "Topic 30: cases positive restrictions disease tested travel health days contact reported outbreak announced spread country symptoms\n",
      "Topic 31: countries ice ban students gun refugees order states visas percent united income college americans experts\n",
      "Topic 32: case court justice judge law charges prosecutors rights trial civil sex lawyers sentence transgender district\n",
      "Topic 33: stock investors billion company investment markets fund bond disney market uber value softbank bonds yahoo\n",
      "Topic 34: colonel imprisoned municipal anthony serve fit uprising measles dose sick tools depot wondered combat bears\n",
      "Topic 35: father king wife queen british prince husband mother family privacy statement royal son princess london\n",
      "Topic 36: mayor blasio city cuomo york hall elected council legislature budget governor albany donor fund gov\n",
      "Topic 37: said weinstein women told one former company know sexual business according wrote times two lawyer\n",
      "Topic 38: chief banks director chicago secretary emanuel commissioner army deputy crime mayor superintendent warren interim acting\n",
      "Topic 39: uber tesla car vehicles cars autonomous technology driving vehicle ride kalanick electric self hailing google\n",
      "Topic 40: players nfl anthem league owners goodell game sports soccer teams team fans play athletes stand\n",
      "Topic 41: countries united european china states trade agreement developed union billion climate chinese india tons emissions\n",
      "Topic 42: korea north south korean missile nuclear kim warmbier seoul ballistic missiles china otto beijing jong\n",
      "Topic 43: president meeting bharara white trump adviser putin francis remarks gen call supremacists washington obama aides\n",
      "Topic 44: problems policing treatments chancellor recession colonel governors unemployment legalize investigations jennifer jessica integrity economist yorkers\n",
      "Topic 45: fbi investigation lawyer intelligence comey campaign russian committee information adviser trump flynn inquiry meeting kushner\n",
      "Topic 46: ali survey egypt tons mexican plastic measles champion communist attitudes hero hunter shipping abdel imported\n",
      "Topic 47: mom happening locked wear sense anxiety coup municipal minnesota feeling usual custody virtue imprisoned inmates\n",
      "Topic 48: economist recession gross jobs statistics municipal employment laid downturn fda yorkers rollout angela essential economists\n",
      "Topic 49: syrian afghan border syria taliban asylum migrants lebanon seekers thousands afghanistan immigration refugees assad rebel\n",
      "======= Time: 6 =======\n",
      "Topic 0: officers officer police man arrested toronto driver brooklyn suspect shot truck rampage queens street bike\n",
      "Topic 1: sexual abuse church victims sex cardinal harassment allegations catholic minors priests rape priest women sexually\n",
      "Topic 2: art space dance buildings artist building neighborhood painting garden auction museum street square artists star\n",
      "Topic 3: guess ball upshot probability eliminated page siena dame slide newsletter notable nepal subscriber manchester headlines\n",
      "Topic 4: school schools students education teachers teacher parents student programs strike profit colleges charter chicago loan\n",
      "Topic 5: doctors home patients getting wave hospital closed medical hospitals oxygen jersey got surgery doctor store\n",
      "Topic 6: one china chinese even people like system just country many time now years know story\n",
      "Topic 7: climate coal plants epa emissions agency wheeler pollution pruitt environmental energy rule rules air proposal\n",
      "Topic 8: republican race candidate candidates democratic election presidential elections run voters governor primary voting republicans votes\n",
      "Topic 9: climate weather tornadoes storm homes warming emissions water tornado heat hurricane change degrees effects emergency\n",
      "Topic 10: republican district democrats republicans democratic vote election trump clinton districts new voters won congressional house\n",
      "Topic 11: senate republicans bill democrats senator tax congress legislation lawmakers house senators spending schumer immigration measure\n",
      "Topic 12: gun officer shooting officers police rifles firearms fire weapons civilian ammunition wilson mass rifle guns\n",
      "Topic 13: israeli israel palestinian palestinians peace macedonia nations jerusalem gaza greece prime kushner name minister greek\n",
      "Topic 14: game world play first second won cup group team triple red players japan jumps win\n",
      "Topic 15: european prime minister union britain brexit party labour spain parliament referendum withdrawal ireland bloc london\n",
      "Topic 16: court supreme courts travel appeals ban judges judge order majority vacancies circuit decision ruling judicial\n",
      "Topic 17: health care insurance medicaid drug income medical obamacare plan higher buy affordable americans act pot\n",
      "Topic 18: facebook privacy data google ads information tech zuckerberg social twitter app users technology cambridge apps\n",
      "Topic 19: game games olympics olympic erdogan sox players treats baseball red switch league chelsea scheme stadium\n",
      "Topic 20: opponent colonel brazilian apologize virtue legalization imprisoned candidacy mayoral honored bizarre reacting angela scientist municipal\n",
      "Topic 21: saudi khashoggi arabia moscow prince mohammed russian crown spy agent poisoning putin consulate kremlin nerve\n",
      "Topic 22: opera season productions film theater nbc production song pop music entertainment show audience musical singing\n",
      "Topic 23: think know going love like good thing want get something just really lot wanted feel\n",
      "Topic 24: hong kong protests macron yellow movement taiwan paris france protesters french beijing vests mainland emmanuel\n",
      "Topic 25: life movie novel books book story novels fiction characters love writer memoir teeth stories marvel\n",
      "Topic 26: growth stock economy economic tax inflation markets rates investors market higher rate walmart interest tariffs\n",
      "Topic 27: confederate church rally charlottesville nationalist charleston protest black violence nationalists statue civil south supremacist carolina\n",
      "Topic 28: saudi khashoggi killing prince crown team officials consulate hit now body later istanbul losses see\n",
      "Topic 29: taliban afghan killed syrian afghanistan islamic attack forces kabul syria insurgents fighters province soldiers coalition\n",
      "Topic 30: cases positive disease tested restrictions travel health outbreak contact spread days reported infected variant infections\n",
      "Topic 31: gun black income americans children white percent men immigrants boys states data study likely immigration\n",
      "Topic 32: court law supreme case judge justice rights legal ruling federal sex act kavanaugh filed unconstitutional\n",
      "Topic 33: stock investors markets company billion fund bond market investment wework bonds funds sky softbank buy\n",
      "Topic 34: colonel imprisoned uprising municipal railway depot mayors anthony measles fit branded scholarship dose wondered metoo\n",
      "Topic 35: prince royal markle father meghan wedding harry palace musk british cave baby queen aisle duchess\n",
      "Topic 36: cuomo governor york ballot primary james gov nixon bridge attorney mayor andrew city fund letitia\n",
      "Topic 37: sexual accusations accused women said investigation harassment denied former resigned state permanent executive fired representative\n",
      "Topic 38: chief banks chicago secretary army myanmar commissioner superintendent emanuel violent director crime warren coup deputy\n",
      "Topic 39: uber car cars vehicles technology driving tesla drivers apple google electric app ride vehicle autonomous\n",
      "Topic 40: players league soccer game teams nfl anthem minor play team sports owners season fans player\n",
      "Topic 41: nuclear sanctions iran trade china united american states deal agreement administration european tariffs chinese weapons\n",
      "Topic 42: korea north south korean kim jong moon nuclear peninsula diplomatic seoul peace pence talks leader\n",
      "Topic 43: president white meeting trump mattis remarks generals aides putin house gen washington jackson obama general\n",
      "Topic 44: treatments chancellor colonel legalize policing governors investigations recession monetary mit integrity delhi jessica apologize problems\n",
      "Topic 45: investigation lawyer fbi mueller counsel campaign justice special attorney trump lawyers cohen inquiry general comey\n",
      "Topic 46: ali hunter egypt communist plastic tons hero opponent mexican muslims delhi tens survey outlets dissent\n",
      "Topic 47: mom happening municipal locked wear coup solitary mayors nights anxiety imprisoned desperate woods virtue minnesota\n",
      "Topic 48: economist recession gross statistics municipal jobs employment downturn laid angela usual yorkers economics christine shrank\n",
      "Topic 49: border migrants immigration asylum syria syrian taliban thousands afghan immigrants seekers refugees lebanon afghanistan homeland\n",
      "======= Time: 7 =======\n",
      "Topic 0: man officer officers police arrested car brooklyn driver traffic vehicle street suspect queens avenue bike\n",
      "Topic 1: epstein sex prosecutors victims sexual charges lab jeffrey financier girls media nbc prosecutor accused women\n",
      "Topic 2: space art museum building estate buildings artist auction neighborhood property museums project apartment square arts\n",
      "Topic 3: page dame notre cathedral melania trumps redacted ball formerly lady interference flames guess mueller mohammed\n",
      "Topic 4: school schools students education teachers parents chicago student charter teacher strike profit admissions colleges programs\n",
      "Topic 5: doctors home patients hospital getting wave hospitals medical closed oxygen town jersey worried fear doctor\n",
      "Topic 6: people think michael like going recording just archived barbaro get one really right know boris\n",
      "Topic 7: climate emissions california cuomo change environmental epa plan pollution agency warming amazon automakers air standards\n",
      "Topic 8: northam governor election republican elections race primary fox democratic candidate run results candidates abdullah voting\n",
      "Topic 9: climate heat tornadoes homes weather tornado water storm pump change electric severe electricity gas areas\n",
      "Topic 10: impeachment senate house process republican clinton vote guilty constitution political republicans office democrats inquiry nixon\n",
      "Topic 11: senate republicans bill senator democrats legislation tax congress budget lawmakers spending mcconnell passed democrat measure\n",
      "Topic 12: officer police officers ashley recording archived michael video garner eric case death barbaro man department\n",
      "Topic 13: netanyahu prime israeli india minister israel arab pakistan kashmir modi hindu palestinian benjamin narendra indian\n",
      "Topic 14: game oregon nike players soccer project parker team manchester play league doping won experiments tennis\n",
      "Topic 15: prime parliament minister brexit european britain union boris london johnson lawmakers theresa british labour opposition\n",
      "Topic 16: vaccine disease measles immunity vaccinated dose received vaccines herd unvaccinated travel drug cdc ineffective patients\n",
      "Topic 17: care health drug fentanyl opioid overdose medical plan income bankruptcy drugs americans insurance prescription oxycontin\n",
      "Topic 18: facebook tech google technology apple app privacy companies information data users social regulators antitrust apps\n",
      "Topic 19: game games wade debates red yankees socialists roe abortions houston choice teammates automatically hurricane opt\n",
      "Topic 20: opponent brazilian apologize angela meal virtue legalization honored imprisoned rand colonel mayoral municipal stall treatments\n",
      "Topic 21: saudi moscow arabia opposition mohammed arrested prince kingdom bin detained navalny arrest kremlin khashoggi crown\n",
      "Topic 22: opera season film disney music singing production musical movies pop performances performance singer streaming metropolitan\n",
      "Topic 23: love book like know really novel good life want baby just story lot daughter think\n",
      "Topic 24: hong kong protesters protests beijing lam extradition tear protest demonstrators pro officers mainland clashes democracy\n",
      "Topic 25: book novel books life read memoir story review fiction writer poetry written movie stories genre\n",
      "Topic 26: inflation economy economic growth rates tax fed stock rate investors interest assets markets market recession\n",
      "Topic 27: shootings paso buttigieg hate racist shooting black church far anti violence mass rally supremacy racism\n",
      "Topic 28: saudi killing khashoggi prince team later crown consulate istanbul body now saudis van officials around\n",
      "Topic 29: taliban afghan iran iraq afghanistan syria forces iranian military israeli hezbollah american attack islamic attacks\n",
      "Topic 30: cases positive disease restrictions tested travel reported days contact health spread variant recently measures outbreak\n",
      "Topic 31: gun percent income immigration immigrants data children likely poor states share average study population researchers\n",
      "Topic 32: court supreme judge justice law case ruling federal legal filed rights courts district ruled decision\n",
      "Topic 33: stock billion investors softbank fund wework company investment markets market funds shares cash financial bond\n",
      "Topic 34: imprisoned colonel municipal uprising scholarship branded railway mayors anthony fit depot provinces feminist wondered pleading\n",
      "Topic 35: prince royal musk harry meghan british statement duchess sussex tabloids rocky family rapper london father\n",
      "Topic 36: democratic sanders race campaign fund candidates buttigieg presidential senator candidate poll primary bernie warren mayor\n",
      "Topic 37: president michael trump going barbaro house think committee democrats recording investigation right just archived know\n",
      "Topic 38: chicago chief myanmar superintendent banks army commissioner lightfoot emanuel coup secretary crime violent ethnic mayor\n",
      "Topic 39: electric delivery cars vehicles app uber apple apps tesla battery google trucks restaurants car sales\n",
      "Topic 40: league players soccer leagues game sport teams clubs fans athletes mlb team athletic play baseball\n",
      "Topic 41: iran china oil sanctions united nuclear iranian trade states administration countries american global deal barrels\n",
      "Topic 42: korea north missile south korean missiles kim ballistic nuclear jong range seoul launched leader talks\n",
      "Topic 43: meeting jackson physician president aides physical putin white nato macron pounds remarks oval trip sean\n",
      "Topic 44: treatments chancellor governors racially legalize mayors mit legalization campuses unemployment janeiro lockdown yorkers monetary angela\n",
      "Topic 45: investigation giuliani special counsel inquiry ukraine ukrainian call mueller lawyer house zelensky complaint prosecutor impeachment\n",
      "Topic 46: tons communist plastic ali egypt hunter hero mexican outlets vladimir survey meat shipping farms khamenei\n",
      "Topic 47: mom locked municipal wear solitary happening describing imprisoned custody breast desperate nights mayors coup obviously\n",
      "Topic 48: economist recession gross statistics municipal jobs employment economics downturn yorkers angela economists shrank depression christine\n",
      "Topic 49: border taliban immigration thousands migrants syria afghan syrian asylum immigrants lebanon migrant afghanistan homeland seekers\n",
      "======= Time: 8 =======\n",
      "Topic 0: officers police officer man arrested video charged protesters car floyd shooting demonstrators protests manhattan williams\n",
      "Topic 1: weinstein sex prosecutors sexual charges lawyers relationship women trial victims rape allegations guilty megan harvey\n",
      "Topic 2: art space artist museum property buildings building estate works neighborhood gallery musical arts manhattan apartment\n",
      "Topic 3: absentee maps ins votes page illustrated ossoff correction incomplete guess counties subscriber dame melania ball\n",
      "Topic 4: schools school students parents children education teachers reopening learning classrooms reopen student classes educators online\n",
      "Topic 5: doctors patients hospital home illness wave oxygen feeling surgery doctor hospitals getting ayatollah bed gloves\n",
      "Topic 6: michael people vaccine like barbaro just going right think recording virus know get one archived\n",
      "Topic 7: cuomo amazon architecture station employees california plan buildings costs manhattan automakers governor space solar andrew\n",
      "Topic 8: election republican senate ballots fraud georgia voting results elections republicans electoral votes michigan runoff senator\n",
      "Topic 9: storm homes storms hurricanes flooding weather areas streets dennis winds flight water climate battered wind\n",
      "Topic 10: republican democratic voters areas vote voting election percent county shift margin share income majority precincts\n",
      "Topic 11: senate republicans democrats senator lawmakers congress postal senators mnuchin changes mail service confirmation legislation bill\n",
      "Topic 12: officer police officers brooks car man floyd richard just know minutes video arrest see back\n",
      "Topic 13: india israel netanyahu israeli prime arab indian modi minister soldiers hindu emirates delhi disputed territory\n",
      "Topic 14: game players league open games djokovic manchester tennis player tournament ball play champions slam soccer\n",
      "Topic 15: prime minister britain european johnson parliament brexit union boris netanyahu london labour british conservative lawmakers\n",
      "Topic 16: patients vaccine study drug vaccines disease researchers trials scientists immune coronavirus cells severe clinical moderna\n",
      "Topic 17: care california schools work rural construction high child warehouse students communities balloons inland residents urban\n",
      "Topic 18: facebook app apple twitter users social google information apps media zuckerberg tech store online platforms\n",
      "Topic 19: game games sports baseball manager red sox championship season anderson player houston coach espn scheme\n",
      "Topic 20: brazilian opponent apologize colonel stall honored rand imprisoned plunge ocasio midterms legalization angela insiders mayoral\n",
      "Topic 21: saudi opposition moscow navalny arabia aleksei putin russian vladimir poisoned kremlin premier poisoning mohammed nerve\n",
      "Topic 22: disney opera streaming season hbo movies production met performances music musical film orchestra warner theaters\n",
      "Topic 23: book really story love best going novel know think wanted like lot just good see\n",
      "Topic 24: hong kong democracy protesters pro protests beijing protest arrested mainland lam communist semiautonomous demonstrators territory\n",
      "Topic 25: book novel books alter prize brown love essay character life genre writer fiction writing published\n",
      "Topic 26: inflation economic economy fed assets growth price businesses stock market rates unemployment food benefits financial\n",
      "Topic 27: black violence church far rally racial racism statue gun richmond hate shooting charleston gay rights\n",
      "Topic 28: climate emissions gas obama environmental read era pollution rule energy interior proposed coal drilling change\n",
      "Topic 29: taliban iran afghan american iranian military attacks iraq attack intelligence afghanistan war forces troops suleimani\n",
      "Topic 30: virus cases coronavirus infections spread tested infected outbreak symptoms disease testing health doctors masks positive\n",
      "Topic 31: cases deaths states data new covid health virus disease state number average coronavirus measures restrictions\n",
      "Topic 32: court supreme justice judge law case legal ruling federal justices rights decision lawyers appeals courts\n",
      "Topic 33: stock markets bond market investors bonds billion financial funds softbank fund money wework recession loeffler\n",
      "Topic 34: colonel imprisoned uprising branded municipal scholarship feminist poet hardened sergeant invaded fit depot ferry shouting\n",
      "Topic 35: royal prince harry meghan family duchess british sussex king queen father couple palace london wife\n",
      "Topic 36: sanders candidate warren candidates democratic senator debate buttigieg race voters iowa presidential campaign bernie primary\n",
      "Topic 37: michael just think people recording president archived really barbaro know like right going election biden\n",
      "Topic 38: homeland violent chief crime acting secretary oklahoma army chicago internet department fbi lethal director executions\n",
      "Topic 39: apple apps app customers bikes sales electric delivery tesla stores mobile cars fees uber battery\n",
      "Topic 40: players league season game nfl teams team games soccer player positive sports titans goodell fans\n",
      "Topic 41: nuclear european sanctions countries trade iran united global china goods tariffs administration agreement nations international\n",
      "Topic 42: china chinese jinping beijing communist taiwan leader politician opening openness decade retirement elites prepares reform\n",
      "Topic 43: president meeting white aides putin elect physician briefing remarks trump house jackson washington secretary conference\n",
      "Topic 44: treatments chancellor legalize legalization janeiro racially mit campuses insiders contraction integrity apologize containers stall mayors\n",
      "Topic 45: investigation inquiry intelligence lawyer attorney hunter general campaign giuliani justice committee information former barr department\n",
      "Topic 46: communist vladimir egypt parade ali plastic dissent tons hero khamenei bishop ayatollah outlets conspiracy muslims\n",
      "Topic 47: imprisoned municipal solitary coup belarus correctional uprising pit confessed woods sergeant nickname lithuania tanks describing\n",
      "Topic 48: economist recession gross statistics municipal shrank employment gdp jobs coffers economics stall christine contraction angela\n",
      "Topic 49: taliban afghan lebanon kabul airlines planes beirut thousands passengers pilgrims migrant afghanistan syria passenger immigration\n",
      "======= Time: 9 =======\n",
      "Topic 0: officers capitol officer police charged riot jan man charges prosecutors boys arrested proud video attack\n",
      "Topic 1: cuomo governor sexual allegations attorney andrew harassment book investigation gov nursing albany cnn women inquiry\n",
      "Topic 2: art space artist museum project artists works gallery buildings manhattan property light taste constitute synagogue\n",
      "Topic 3: queue lately absentee ossoff enjoying classical maps listening insults runoff subscriber defeats raphael warnock dogs\n",
      "Topic 4: schools school students education parents masks teachers learning blasio testing educators vaccinated children reopen mandate\n",
      "Topic 5: doctors oxygen hospital patients home died hospitals illness bed standoff father doctor town survived medical\n",
      "Topic 6: vaccine people michael just get know right think one going really like vaccines barbaro now\n",
      "Topic 7: labor workers amazon order climate employers emissions architecture unions clean plants rule coal architects energy\n",
      "Topic 8: republican republicans election senate georgia greene former senator voting democrats elections donald representative cheney fraud\n",
      "Topic 9: water storm weather building fire flooding surfside condo champlain collapse winter rain rubble collapsed toll\n",
      "Topic 10: democrats voting senate republican president rights republicans vote election bill house voters votes trump congress\n",
      "Topic 11: democrats republicans senate bill legislation lawmakers senator package tax budget support democrat congress trillion infrastructure\n",
      "Topic 12: police officers capitol officer now floyd rioters just car minutes going mob crowd first security\n",
      "Topic 13: israel israeli netanyahu gaza hamas palestinian prime jerusalem palestinians israelis arab aviv tel minister conflict\n",
      "Topic 14: game league players games fans ball soccer play player series open nets won points win\n",
      "Topic 15: prime netanyahu minister coalition parliament parties party elections opposition wing benjamin seats parliamentary majority israel\n",
      "Topic 16: vaccine johnson doses vaccines study covid drug risk dose pfizer shot disease patients shots researchers\n",
      "Topic 17: care child fentanyl drug income overdose opioid pay families often pills oxycontin prescription medicaid overdoses\n",
      "Topic 18: app facebook apple users apps instagram digital online zuckerberg products technology software company tech social\n",
      "Topic 19: game games red sox tokyo olympic athletes olympics series boston sports championship baseball medal houston\n",
      "Topic 20: opponent apologize brazilian honored ocasio rand colonel imprisoned stall bizarre angela defendant apologizes insiders fantasy\n",
      "Topic 21: moscow navalny putin russian opposition aleksei vladimir kremlin saudi russians poisoning poisoned agent sentenced prison\n",
      "Topic 22: broadway musical performances theater opera best cast production performance shows theaters show actress producers awards\n",
      "Topic 23: think feel know lot really love story something work get going productivity getting book like\n",
      "Topic 24: hong kong protesters beijing protests democracy pro chinese protest mainland taiwan arrested communist territory demonstrations\n",
      "Topic 25: book novel books writer brown space published reader publishers friends publish written simon story memoir\n",
      "Topic 26: inflation economic economy growth market price fed bond prices supply bank rates job assets higher\n",
      "Topic 27: black catholic asian church warnock conservative vatican hate rights nation cardinal civil catholics baptist anti\n",
      "Topic 28: climate gas power change emissions carbon world global energy coal natural feb big electric solar\n",
      "Topic 29: taliban afghan afghanistan forces kabul american troops military airstrikes iran provincial withdrawal iranian fighters pentagon\n",
      "Topic 30: variant cases infections omicron restrictions travel tested infected delta positive coronavirus symptoms africa quarantine vaccinated\n",
      "Topic 31: health cases vaccinated vaccine said new covid data state virus vaccination deaths care states variant\n",
      "Topic 32: court law supreme justice abortion texas legal judge case ruling federal decision filed justices constitutional\n",
      "Topic 33: stock investors market markets shares billion bond financial company trading firm fed sell disney exchange\n",
      "Topic 34: colonel imprisoned uprising branded fit sergeant municipal scholarship pleading sat solitary feminist hair shouting mit\n",
      "Topic 35: meghan royal harry family prince interview queen palace london british duchess couple diana princess father\n",
      "Topic 36: rent york eviction tenants housing moratorium evictions relief landlords renters rental hochul assistance new program\n",
      "Topic 37: said killed family building rescue father search told gaza day collapse victims israel two children\n",
      "Topic 38: chief crime banks army brazil confirmed violent coup chicago janeiro acting confirmation generals bureau cabinet\n",
      "Topic 39: electric cars sales vehicles tesla battery car bikes ford bike trucks automakers shortage quarter sold\n",
      "Topic 40: league players soccer team clubs teams game racism super season breakaway games nfl leagues nba\n",
      "Topic 41: european britain nuclear ireland countries union taxes tax global iran uranium bloc international agreement sanctions\n",
      "Topic 42: china beijing chinese taiwan missile communist korea jinping foreign ballistic japan north leader official strategy\n",
      "Topic 43: president putin meeting nato russia biden vladimir white alliance moscow sanctions ukraine vice trump allies\n",
      "Topic 44: chancellor racially treatments mit tiktok apologize legalize theory janeiro cortez campuses mayors policing legalization insiders\n",
      "Topic 45: intelligence committee investigation justice department fbi report political members records campaign candidate prosecutors money reporters\n",
      "Topic 46: communist ali ayatollah khamenei plastic opponent egypt hero lab fury shape tons muslims dissent shipping\n",
      "Topic 47: imprisoned solitary pleading confessed coup nickname municipal pit germans uprising describing sergeant farming fit confession\n",
      "Topic 48: economist recession gross statistics municipal gdp stall shrank angela labour monument coffers christine contraction layoffs\n",
      "Topic 49: taliban lebanon hezbollah thousands belarus beirut kabul syria afghan lithuania border assad afghans bashar militant\n",
      "======= Time: 10 =======\n",
      "Topic 0: prosecutors officer charges capitol officers guilty charged police man floyd sentence trial jan jury chauvin\n",
      "Topic 1: sexual sex allegations crimes cuomo attorney investigation cnn weinstein walker abuse academy trial smith women\n",
      "Topic 2: art museum space ballet ancient artist painting light paris century design exhibition works italy jewelry\n",
      "Topic 3: queue reading listening documentary watching margaret independents recounts enslaved kennedy reviews desk editor lisa wine\n",
      "Topic 4: school students schools teachers education classrooms elementary parents student chicago schooling classroom gunman remote classes\n",
      "Topic 5: doctors ayatollah khamenei surgery home father hearts supermarket bed sun town mothers someone hospital turned\n",
      "Topic 6: like just get know school really going people now patients speaker covid right back emily\n",
      "Topic 7: irs yellen agency station climate overhaul plan amtrak treasury funding tunnel service penn taxpayers revenue\n",
      "Topic 8: republican election elections republicans democratic voting fraud governor race presidential congressional victory candidates democrats results\n",
      "Topic 9: storm hurricane residents water winds florida fort weather storms myers coast homes ian snow miles\n",
      "Topic 10: republican republicans democrats abortion voters said senate vote support democratic senator candidates american issue campaign\n",
      "Topic 11: senate bill democrats republicans legislation senator lawmakers measure sinema congress bipartisan parties democrat tax support\n",
      "Topic 12: police officers capitol now rioters building officer house first inside going mob two crowd chief\n",
      "Topic 13: israeli israel palestinian jerusalem palestinians jews arab bank gaza abu mosque west rabbi clashes orthodox\n",
      "Topic 14: game won best ball players season series win toe team play games jump triple halfway\n",
      "Topic 15: prime minister parliament johnson coalition parties boris party netanyahu government elections opposition downing political wing\n",
      "Topic 16: vaccine doses study disease monkeypox patients covid dose vaccines drug shots fda treatment researchers hepatitis\n",
      "Topic 17: income schools abortion gig found medication abortions increase students teachers benefits employment care method providence\n",
      "Topic 18: twitter musk company deal tesla board social media facebook airlines buy stock elon frontier spirit\n",
      "Topic 19: game athletes griner sport tennis brittney formula racing players fame games races sports championship olympics\n",
      "Topic 20: opponent ocasio apologize brazilian colonel folks candidacy corrupt presidency surprised opposing politicians honored undermining oval\n",
      "Topic 21: saudi arabia golf human opposition yemen rights kingdom sports prince corruption wealth bin mohammed arrested\n",
      "Topic 22: scene film movies opera episodes series viewers directors magic comedy actor camera sequence motives actress\n",
      "Topic 23: book shame really think love want writes character schiff good something writing science horror opera\n",
      "Topic 24: ukrainian kyiv plant brittney stampede pilots thailand stadium drones soccer siberian mykolaiv mourners zaporizhzhia rejects\n",
      "Topic 25: book novel mccarthy space martin books stories writing cancer published portrait writer nasa husband life\n",
      "Topic 26: inflation prices rates percent economy investors price market interest fed year rate bank higher growth\n",
      "Topic 27: black catholic native mass civil church south pope campus francis asian university rights hate tribal\n",
      "Topic 28: russian forces war ukraine russia military ukrainian soldiers troops putin said region official officials kyiv\n",
      "Topic 29: taliban afghan iran iranian iraqi afghanistan iraq forces shiite kabul kurdish islamic baghdad groups guards\n",
      "Topic 30: variant cases restrictions infections isolation omicron hong quarantine tested indoor delta hospitalizations kong infected travel\n",
      "Topic 31: health cases medical covid response taiwan virus workers credit infections new vaccine disease deaths pandemic\n",
      "Topic 32: court law texas supreme transgender ruling legal abortion judge rights laws rule wrote federal decision\n",
      "Topic 33: stock bond market investors bank markets financial banks bonds billion funds investment profit quarter goldman\n",
      "Topic 34: colonel imprisoned fit branded hair uprising vendors scholarship assassinated metoo wrongly greatest activist khamenei blockbuster\n",
      "Topic 35: queen prince royal palace elizabeth london family british son monarch buckingham throne father wife andrew\n",
      "Topic 36: york city mayor correction housing trash new rent adams homelessness jail landlords cuomo moratorium yorkers\n",
      "Topic 37: ukraine military michael russian war putin said times one soldiers russia york ukrainian troops front\n",
      "Topic 38: chief internet banks army chicago crime secretary brazil deputy fauci acting bureau violent department confirmed\n",
      "Topic 39: apple google sales technology tech vehicles cars tesla electric products car computer product app apps\n",
      "Topic 40: team league season players coach nba nets teams sports game brady football nfl soccer finals\n",
      "Topic 41: gas russia prices energy european europe oil natural sanctions germany russian price nord supplies imports\n",
      "Topic 42: china chinese beijing taiwan communist jinping kong hong strait korea mao japan foreign decade party\n",
      "Topic 43: putin nato vladimir alliance sweden finland moscow turkey meeting membership sanctions president russia summit ukraine\n",
      "Topic 44: tiktok theory cortez rand racially ayatollah shake francis giuliani congresswoman laughter bernie greatest jennifer thank\n",
      "Topic 45: documents justice trump former investigation committee fbi information classified house search archives department lawyers jan\n",
      "Topic 46: communist ali egypt tons hero conspiracy plastic muslims opponent dissent ayatollah hunter khamenei outlets shipping\n",
      "Topic 47: solitary fit imprisoned mom vendors angela describing municipal confessed nickname pleading coup farming fattah macron\n",
      "Topic 48: economist recession gross statistics municipal jobs vermont politicians suspicions stall angela monument employment predecessor laid\n",
      "Topic 49: border migrants immigration taliban thousands asylum homeland undocumented humanitarian immigrants syria afghan rio order crossing\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "11it [03:56, 21.49s/it]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "dynamic_TC:  0.5394247966925868\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 11/11 [00:00<00:00, 25.93it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "dynamic_TD:  0.7042424242424242\n",
      "{'Purity': 0.6339869281045751, 'NMI': 0.34175043973103136}\n",
      "{'acc': 0.6023965141612201, 'macro-F1': 0.3720168939430668}\n"
     ]
    }
   ],
   "source": [
    "########################### Evaluate ####################################\n",
    "from topmost import eva\n",
    "\n",
    "# get theta (doc-topic distributions)\n",
    "train_theta, test_theta = trainer.export_theta()\n",
    "\n",
    "train_times = dataset.train_times.cpu().numpy()\n",
    "# compute topic coherence\n",
    "dynamic_TC = eva.dynamic_coherence(dataset.train_texts, train_times, dataset.vocab, top_words)\n",
    "print(\"dynamic_TC: \", dynamic_TC)\n",
    "\n",
    "# compute topic diversity\n",
    "dynamic_TD = eva.dynamic_diversity(top_words, dataset.train_bow.cpu().numpy(), train_times, dataset.vocab)\n",
    "print(\"dynamic_TD: \", dynamic_TD)\n",
    "\n",
    "# evaluate clustering\n",
    "results = eva._clustering(test_theta, dataset.test_labels)\n",
    "print(results)\n",
    "\n",
    "# evaluate classification\n",
    "results = eva._cls(train_theta, test_theta, dataset.train_labels, dataset.test_labels)\n",
    "print(results)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "torch1.13py3.8",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.17"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
